﻿using RPAVIEW.util;
using RPAVIEW.views.controlLibrary;
using System.Windows.Controls;
namespace RPAVIEW.views.EditPage.flows.GetOpenedWebObjN {
    /// <summary>
    /// Input.xaml 的交互逻辑
    /// </summary>
    public partial class Input:BaseParamViewAction{
        public Input() {
            InitializeComponent();
        }

        public override void UpdateSource() {
            this.matchContent.GetBindingExpression(SelVarTextBox.text).UpdateSource();
            this.browserType.GetBindingExpression(ComboBox.SelectedIndexProperty).UpdateSource();
            this.matchType.GetBindingExpression(ComboBox.SelectedIndexProperty).UpdateSource();
        }
        private void MatchTypeChanged(object sender, SelectionChangedEventArgs e) {
            int matchType = this.matchType.SelectedIndex;
            if(matchType == 0) {
                ElementUtil.HideRow(this.matchContentrow);
            }else if(matchType == 1) {
                ElementUtil.ShowRow(this.matchContentrow);
                this.matchContentLabel.Content = "标题";
            } else {
                ElementUtil.ShowRow(this.matchContentrow);
                this.matchContentLabel.Content = "网址";
            }
        }
    }
}
